import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '用户ID',
    align:"center",
    dataIndex: 'userId'
   },
   {
    title: '订单编号',
    align:"center",
    dataIndex: 'orderNum'
   },
   {
    title: '是否包邮',
    align:"center",
    dataIndex: 'freeShipping_dictText'
   },
   {
    title: '订单状态',
    align:"center",
    dataIndex: 'orderState_dictText'
   },
   {
    title: '订单总价',
    align:"center",
    dataIndex: 'orderPrice'
   },
   {
    title: '订单运费',
    align:"center",
    dataIndex: 'transportation'
   },
   {
    title: '应付金额',
    align:"center",
    dataIndex: 'payable'
   },
   {
    title: '支付时间',
    align:"center",
    dataIndex: 'payTime'
   },
   {
    title: '支付状态',
    align:"center",
    dataIndex: 'payState_dictText'
   },
   {
    title: '支付方式',
    align:"center",
    dataIndex: 'payment_dictText'
   },
   {
    title: '流水号',
    align:"center",
    dataIndex: 'serialNum'
   },
   {
    title: '收货人',
    align:"center",
    dataIndex: 'consignee'
   },
   {
    title: '联系电话',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '收货地址',
    align:"center",
    dataIndex: 'addressDetail'
   },
   {
    title: '发货状态',
    align:"center",
    dataIndex: 'deliverGoods_dictText'
   },
   {
    title: '发货时间',
    align:"center",
    dataIndex: 'deliveryTime'
   },
   {
    title: '物流单号',
    align:"center",
    dataIndex: 'logisticsNum'
   },
   {
    title: '收货时间',
    align:"center",
    dataIndex: 'receivingTime'
   },
   {
    title: '是否售后',
    align:"center",
    dataIndex: 'isDrawback_dictText'
   },
   {
    title: '退款状态',
    align:"center",
    dataIndex: 'drawbackState_dictText'
   },
   {
    title: '退款金额',
    align:"center",
    dataIndex: 'drawbackAmount'
   },
   {
    title: '退款时间',
    align:"center",
    dataIndex: 'amountTime'
   },
   {
    title: '关闭时间',
    align:"center",
    dataIndex: 'ordercloseTime'
   },
   {
    title: '是否删除',
    align:"center",
    dataIndex: 'isDelete_dictText'
   },
   {
    title: '订单备注',
    align:"center",
    dataIndex: 'orderRemark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户ID',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '订单编号',
    field: 'orderNum',
    component: 'Input',
  },
  {
    label: '是否包邮',
    field: 'freeShipping',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     },
  },
  {
    label: '订单状态',
    field: 'orderState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"order_state"
     },
  },
  {
    label: '订单总价',
    field: 'orderPrice',
    component: 'InputNumber',
  },
  {
    label: '订单运费',
    field: 'transportation',
    component: 'InputNumber',
  },
  {
    label: '应付金额',
    field: 'payable',
    component: 'InputNumber',
  },
  {
    label: '支付时间',
    field: 'payTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '支付状态',
    field: 'payState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"pay_state"
     },
  },
  {
    label: '支付方式',
    field: 'payment',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"payment"
     },
  },
  {
    label: '流水号',
    field: 'serialNum',
    component: 'Input',
  },
  {
    label: '收货人',
    field: 'consignee',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '收货地址',
    field: 'addressDetail',
    component: 'Input',
  },
  {
    label: '发货状态',
    field: 'deliverGoods',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"send_state"
     },
  },
  {
    label: '发货时间',
    field: 'deliveryTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '物流单号',
    field: 'logisticsNum',
    component: 'Input',
  },
  {
    label: '收货时间',
    field: 'receivingTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '是否售后',
    field: 'isDrawback',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     },
  },
  {
    label: '退款状态',
    field: 'drawbackState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sales_state"
     },
  },
  {
    label: '退款金额',
    field: 'drawbackAmount',
    component: 'Input',
  },
  {
    label: '退款时间',
    field: 'amountTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '关闭时间',
    field: 'ordercloseTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '是否删除',
    field: 'isDelete',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     },
  },
  {
    label: '订单备注',
    field: 'orderRemark',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}